<tagLib name="html,cx" />
<include file="Public:header" />
<script type="text/javascript">
	jQuery(document).ready(function(){
		jQuery('#module').change(function(){
			var module=jQuery('#module').attr("selected","selected").val();
			(module=='3')?jQuery('#moduletype').show():jQuery('#moduletype').hide();
		});
	});
	function edit_link(){
		jQuery('#link').attr('disabled', '');
		if(jQuery('#link_open').val()==''){
			jQuery('#link_open').get(0).value=1;
		}else{
			jQuery('#link_open').get(0).value="";
			jQuery('#link').attr('disabled', 'disabled');
		}
	}	
</script>
<script type="text/javascript">
<!--
var isIE = false;
var isFF = false;

if ((navigator.userAgent.indexOf("MSIE")>0) && (parseInt(navigator.appVersion) >=4)) isIE = true;
if (navigator.userAgent.indexOf("Firefox")>0) isFF = true;

function isNUM(e)
{
	var iKeyCode = window.event?e.keyCode:e.which;
	if(!(((iKeyCode >= 48) && (iKeyCode <= 57)) || (iKeyCode == 13) || (iKeyCode == 46) || (iKeyCode == 45) || (iKeyCode == 37) || (iKeyCode == 39) || (iKeyCode == 8)))
	{  
		if (isIE)
		{
			e.returnValue=false;
		}
		else
		{
			e.preventDefault();   //重要 firefox是用prevenDefault()来取消事件的
		}
	}
}  
//-->
</script>
<div class="bodyTitle">
	<div class="bodyTitleLeft"></div>
  <div class="bodyTitleText">编辑菜单子页面</div>
</div>
<br><h3 class="marginbot"><a href="__URL__" class="sgbtn">＋返回菜单管理</a></h3>
          <table width="100%">  <form method="post" name="form1" action="__URL__/edits">
          <input name="id" type="hidden" id="id" value="{$vo.id}" />
            <tr>
              <td width="13%">菜单名称</td>
              <td width="87%">
                <input name="name" type="text"  class="txt" id="name" value="{$vo.name}" size="50"/></td>
		    </tr>
			<tr>
				<td>所属模型</td>
				<td>
					<select name="module" id="module" />
						<volist name="moduletype" id="val"  key="k">
						<option value="{$k}" <if condition="($vo.module eq $k)">selected="selected"</if> >{$val}</option>
						</volist>
					</select>
				</td>
			</tr>
            <tr id="moduletype" style="display:<if condition='($vo.module eq -1)'><else />none</if>" >
              <td>菜单子页面</td>
			  <td><volist name="pages" id="pages">
				  <input type="checkbox" value={$pages.id} name="pid[]" <if condition="($pages.checked eq 1)">checked="checked"</if> />{$pages.subject}<br />
				  </volist>
              </td>
            </tr>
            <tr>
              <td>菜单的链接</td>
			  <td><input type="text" id="link" name="link" value="{$vo.link}" disabled="disabled" /> 
				  <input type="button" id="edit" onclick="edit_link()" value="编辑" class="inputButton" />
				  <input type="hidden" id="link_open"  />
			  </td>
            </tr>
            <tr>
              <td>排序</td>
              <td><input type="text" id="sortrank" name="sortrank" value="{$vo.sortrank}" size="2" onkeypress="return isNUM(event)" maxlength="2" /></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>
                <input type="submit" name="Submit2" value="提交更新" class="inputButton" />
                <input type="reset" name="Reset" value="还原重填" class="inputButton" /></td>
            </tr>
          </form></table>
        <p class="i">删除不可恢复,谨慎操作</p>
        <br>
<include file="Public:footer" />
